@echo off

echo ### Preparing virtualenv...
cd venv\Scripts
call activate.bat
cd ..\..
echo ### Preparing virtualenv... Done

::echo ### Installing pyinstaller...
::pip install pyinstaller > nul 2>&1
::pip install pypiwin32 > nul 2>&1
::echo ### Installing pyinstaller... Done

echo ### Installing packages...
pip install chardet > nul 2>&1
echo ### Installing packages... Done

echo ### Building exe...
python -m PyInstaller -F scripts\Main.pyw -n backup
echo ### Building exe... Done

echo ### Copying misc...
xcopy bin\* dist\bin\ /S /E /Y
echo ### Copying misc... Done

echo ### Leaving virtualenv...
cd venv\Scripts
call deactivate.bat
cd ..\..
echo ### Leaving virtualenv... Done
